from common.client import RequestsClient
from common.file_load import load_yaml_file


class BasePrimeAdminApi(RequestsClient):
    prime_admin_token = ''  # 初始定义是个空值，那么在整个框架层面，必须先完成该属性的赋值
    """
    运营平台请求头信息
    """

    def __init__(self):
        super().__init__()
        self.host = load_yaml_file('/config/http.yml')['prime_admin_test']
        self.headers = {
            "Content-Type": "application/json;charset=UTF-8",
            "Accept": "application/json, text/plain, */*",
            "Authorization": f"Bearer {self.prime_admin_token}"
        }


class BasePrimeSpApi(RequestsClient):
    prime_sp_token = ''
    """
    服务商请求头信息
    """

    def __init__(self):
        super().__init__()
        self.host = load_yaml_file('/config/http.yml')['prime_sp_test']
        self.headers = {
            "Content-Type": "application/json;charset=UTF-8",
            "Accept": "application/json, text/plain, */*",
            "Authorization": f"Bearer {self.prime_sp_token}"
        }
